package com.hx.interview;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author MinghuaChen
 * @date 2022-03-02 21:29
 * @description
 */
public class SortKingdee {

    public static void main(String[] args) {


    }

    public void groups(List<Row> rows) {
        Map<String, List<Row>> map = new HashMap<>();
        for (Row row : rows) {
            if (map.containsKey(row.getType())) {
                map.get(row).add(row);
            } else {
                List<Row> list = new ArrayList<>();
                list.add(row);
                map.put(row.getType(), list);
            }
        }
    }


    class Row {
        public String type;
        public String number;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getNumber() {
            return number;
        }

        public void setNumber(String number) {
            this.number = number;
        }
    }

}
